<?php
/**
 * Created by PhpStorm.
 * User: Pico_Dragon
 * Date: 15/12/2014
 * Time: 04:28
 */
include "../../db/dbConnect.php";
include "../function/mysql.php";
error_reporting(E_ALL && ~ E_NOTICE);

if($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['idq']) {
    $idq=escape($_POST['idq']);
    $sql = "update u_profile_question set deleted=1 where idpr_question='" .$idq. "'";

    if (mysql_query($sql)) {
        $sql = "update u_profile_answer set deleted=1 where idquestion='" .$idq. "'";
        if(mysql_query($sql)){
            echo "Bạn vừa xóa thành công ";
        }else{
            echo mysql_error();
            exit();
        }

    }else{
        echo mysql_error();
        exit();
    }
}
?>